package com.htd.erp.model;

import java.math.BigDecimal;

import javax.persistence.Embeddable;

@Embeddable
public class PriceDetail {
	
	private int quantity;
	
	private BigDecimal unitPrice = new BigDecimal(0);
	
	private BigDecimal totalPrice = new BigDecimal(0);
	
	public void calculateTotalPrice() {
		totalPrice = unitPrice.multiply(new BigDecimal(quantity));
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public BigDecimal getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}

	public BigDecimal getTotalPrice() {
		calculateTotalPrice();
		return totalPrice;
	}

	public void setTotalPrice(BigDecimal totalPrice) {
		this.totalPrice = totalPrice;
	}
}
